﻿<%@ Page Language="C#" MasterPageFile="~/Users/Users.Master" AutoEventWireup="true"
    CodeBehind="ViewListOrganization.aspx.cs" Inherits="Pantry.Web.Users.ViewListOrganization"
    Title="List Organization" %>
<%@ Register TagPrefix="cc1" Namespace="SiteUtils" Assembly="CollectionPager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="CollectionPager" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroupAll" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup0" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup2" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup3" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup4" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup5" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkGroup6" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkSortByName" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkSortByAddress1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkSortPostCode" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkSortContact" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkSortByActivated" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="CheckBoxIncludeActivate" EventName="CheckedChanged" />
        </Triggers>
        <ContentTemplate>
            <div class="g_12 tienvn_panel">
                <div class="widget_header">
                    <h4 class="widget_header_title wwIcon i_16_tables">
                        Organization List
                    </h4>
                </div>
                <div class="dtBottom">
                <div class="dtPagination more" style="float:left;margin-left:-15px;">
                    <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_0_paginate">
                        <span><asp:LinkButton ID="LinkGroupAll" Text="All" runat="server" OnClick="LinkGroupAllClick"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup0" Text="0-9" runat="server" OnClick="LinkGroup0Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup1" Text="A B C D E" runat="server" OnClick="LinkGroup1Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup2" Text="F G H I J" runat="server" OnClick="LinkGroup2Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup3" Text="K L M N" runat="server" OnClick="LinkGroup3Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup4" Text="O P Q R" runat="server" OnClick="LinkGroup4Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup5" Text="S T U V" runat="server" OnClick="LinkGroup5Click"></asp:LinkButton></span> 
                        <span><asp:LinkButton ID="LinkGroup6" Text="W X Y Z" runat="server" OnClick="LinkGroup6Click"></asp:LinkButton></span> 
                    </div>
                </div>
                <div class="active-panel">
                    <asp:CheckBox ID="CheckBoxIncludeActivate" runat="server" CssClass="simple_form abc" AutoPostBack="True" Checked="true" OnCheckedChanged="CheckboxIsActiveChanged"/><label class="simple_form" for="CheckBoxIncludeActivate"> Include in-active</label>
                </div>
                <asp:Button ID="ButtonCreate" Text="Create" runat="server" OnClick="CreateSupportClick" CssClass="buttonCreateDepartment"></asp:Button>
                </div>
                <div style="clear: both;">
                </div>
                <div class="widget_contents noPadding">
                    <table class="tables">
                        <thead>
                            <tr>
                                <th class="sorting">
                                    <asp:LinkButton ID="LinkSortByName" runat="server" Text="Organization Name" OnClick="SortNameClick" />
                                </th>
                                <th class="sorting">
                                    <asp:LinkButton ID="LinkSortByAddress1" runat="server" Text="Head Office Address Line 1"
                                        OnClick="SortAddress1Click" />
                                </th>
                                <th class="sorting">
                                    <asp:LinkButton ID="LinkSortPostCode" runat="server" Text="Postcode" OnClick="SortPostCodeClick" />
                                </th>
                                <th class="sorting">
                                    <asp:LinkButton ID="LinkSortContact" runat="server" Text="Contact" OnClick="SortContactClick" />
                                </th>
                                <th class="sorting">
                                    <asp:LinkButton ID="LinkSortByActivated" runat="server" Text="Is Active" OnClick="SortIsActiveClick" />
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="RepeaterListOrganization" runat="server" OnItemCommand="MarkActivated">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <a href='OrganizationDetails.aspx?id=<%#Eval("Id") %>&action=update'><%#Eval("Name") %></a>
                                            <%--<asp:HiddenField ID="HiddenFieldOrganizationId" runat="server" Value='<%#Eval("ID")%>' />
                                            <asp:LinkButton ID="LinkButton1" runat="server" ><%#Eval("Name")%></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton2" runat="server" Visible='<%#Eval("IsActive").Equals("No")? true : false %>'
                                                OnClientClick="return confirm('Do you want to make this Organization active?');"
                                                CommandName="update"><%#Eval("Name")%></asp:LinkButton>--%>
                                        </td>
                                        <td>
                                            <%# Eval("Address1")%>
                                        </td>
                                        <td>
                                            <%# Eval("PostCode")%>
                                        </td>
                                        <td>
                                            <%# Eval("Fullname")%>
                                        </td>
                                        <td>
                                            <%# Eval("IsActive")%>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                    <div class="dtBottom">
                        <div class="dtPagination">
                            <cc1:CollectionPager ID="CollectionPager" runat="server" HideOnSinglePage="false"
                                BackText="Back" FirstText="First" ShowLabel="False" ShowFirstLast="False" NextText="Next"
                                ResultsLocation="None" PageNumbersSeparator=" " PagingMode="PostBack">
                            </cc1:CollectionPager>
                        </div>
                    </div>
                </div>
            </div>
            <asp:Panel ID="PanelPopupViewOrganization" Visible="false" runat="server" CssClass="">
                <h4 class="widget_header_title wwIcon i_16_forms" style="font-weight: bold;">
                    Organization Details
                </h4>
                <table width="100%" border="0">
                    <tr>
                        <td class="AlignTd">
                            URL <span style="color: Red">*</span>
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="TextBoxEditUrl" ValidationGroup="EditGroup" />
                        </td>
                        <td class="AlignTd">
                            Added By
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxAddedBy" runat="server" Enabled="false" ValidationGroup="EditGroup" />
                        </td>
                    </tr>
                    <tr>
                        <td class="AlignTd">
                            Description
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxEditDes" runat="server" TextMode="MultiLine" Rows="5" ValidationGroup="EditGroup" />
                        </td>
                        <td class="AlignTd">
                            Added Date
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxAddedDate" runat="server" Enabled="false" ValidationGroup="EditGroup" />
                        </td>
                    </tr>
                    <tr>
                        <td class="AlignTd">
                            Type
                        </td>
                        <td>
                            <asp:DropDownList CssClass="simple_form" runat="server" ID="DropDownListEditType"
                                ValidationGroup="EditGroup">
                                <asp:ListItem Value="doc" Selected="True">Doc</asp:ListItem>
                                <asp:ListItem Value="pdf">PDF</asp:ListItem>
                                <asp:ListItem Value="excel">Excel</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="TextBoxId" Visible="false" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Button ID="Button2" runat="server" Text="Save" ValidationGroup="EditGroup" />
                            <asp:Button ID="Button3" runat="server" Text="Close" />
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        $(document).ready(function() {
            $('ul.tab_nav li').removeClass("active_tab");
            $('ul.tab_nav li.i_32_charts').addClass("active_tab");
        });
    </script>

</asp:Content>
